<?php

class UserMessageForm extends BaseForm
{

  public function configure ()
  {
    
    $this->widgetSchema->setNameFormat('user_message[%s]');
    
    $this->widgetSchema['subject'] = new sfWidgetFormInputText();
    $this->widgetSchema['message'] = new sfWidgetFormTextarea();
    $this->widgetSchema['user_list'] =  new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser'));
    
    $this->validatorSchema['subject'] = new sfValidatorString(array('required' => true));
    $this->validatorSchema['message'] = new sfValidatorString(array('required' => true));
    $this->validatorSchema['user_list'] = new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser', 'required' => true));
  }
}